CXXFLAGS =	-O2 -g -Wall 

ECHO = echo
DIRS = udp-server udp-client

CXX = g++

OBJS =	 UdpServer.o UdpPlayer.o UdpClient.o robak-ncurses-scr.o game-printer.o \
		 SnakePlayer.o SnakeSegment.o MyMap.o ClientSideSynchronizer.o ServerSideSynchronizer.o \
		 PlayerSynchronizer.o PlayerMoves.o

LIBS =  -lncurses -lmenu -lform -lpthread

TARGET =	robak-ncurses-scr

$(TARGET):	$(OBJS)
	$(CXX) -o $(TARGET) $(OBJS)  $(LIBS)

UdpServer.o : force_look
	$(ECHO) looking into subdir : $(MAKE) $(MFLAGS)
	cd udp-server; $(MAKE) $(MFLAGS)
	
UdpClient.o : force_look
	$(ECHO) looking into subdir : $(MAKE) $(MFLAGS)
	cd udp-client; $(MAKE) $(MFLAGS)
	
all:	$(TARGET)

force_look :
	true
	
clean:
	rm -f $(OBJS) $(TARGET)
